home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / pmake / RCS / kernelObj.mk,v < prev    next >
Encoding:
Text File  |  1988-05-27  |  6.1 KB  |  326 lines

  1. head     1.8;
  2. access   ;
  3. symbols  ;
  4. locks    ; strict;
  5. comment  @@;
  6.  
  7.  
  8. 1.8
  9. date     88.05.27.15.39.55;  author deboor;  state Exp;
  10. branches ;
  11. next     1.7;
  12.  
  13. 1.7
  14. date     88.05.17.13.33.01;  author deboor;  state Exp;
  15. branches ;
  16. next     1.6;
  17.  
  18. 1.6
  19. date     88.05.04.14.04.23;  author deboor;  state Exp;
  20. branches ;
  21. next     1.5;
  22.  
  23. 1.5
  24. date     88.04.29.18.34.33;  author deboor;  state Exp;
  25. branches ;
  26. next     1.4;
  27.  
  28. 1.4
  29. date     88.04.29.18.27.24;  author deboor;  state Exp;
  30. branches ;
  31. next     1.3;
  32.  
  33. 1.3
  34. date     88.03.28.13.35.00;  author deboor;  state Exp;
  35. branches ;
  36. next     1.2;
  37.  
  38. 1.2
  39. date     88.03.28.12.56.25;  author deboor;  state Exp;
  40. branches ;
  41. next     1.1;
  42.  
  43. 1.1
  44. date     88.03.24.19.47.01;  author deboor;  state Exp;
  45. branches ;
  46. next     ;
  47.  
  48.  
  49. desc
  50. @Included makefile for kernel module machine-specific directory
  51. @
  52.  
  53.  
  54. 1.8
  55. log
  56. @Added -I. to allow machine-independent files to include
  57. machine-dependent ones.
  58. @
  59. text
  60. @#
  61. # Main file for creating the object files for a kernel module
  62. # Variables:
  63. #    SRCS        All sources used to make the module
  64. #    CSRCS        All C-code sources
  65. #    SSRCS        All assembly-language sources
  66. #    HDRS        All headers in the module
  67. #    MODULE        The module being created (e.g. fs, vm, etc.)
  68. #    MACH        Machine for which module is being created (UPPER-CASE)
  69. #    MACHDIR        Machine-specific directory prefix (lower-case)
  70. #    LINTLIBS    All lint libraries not including that for this
  71. #            module.
  72. #
  73. # $Header: kernelObj.mk,v 1.7 88/05/17 13:33:01 deboor Exp $ SPRITE (Berkeley)
  74. #
  75.  
  76. PROFDIR        ?= /sprite/src/kernel/Profiled/$(MACHDIR)
  77. BINDIR        ?= /sprite/cmds
  78. INCLUDEDIR    ?= /sprite/src/kernel/Include
  79. LINTDIR        ?= /sprite/src/kernel/Lint
  80. LIBDIR        ?= /sprite/src/kernel/$(MACHDIR).md
  81. INSTALLDIR    ?= /sprite/src/kernel/Installed/$(MODULE)/$(MACHDIR).md
  82.  
  83. OBJS        = $(SRCS:S/.c$/.o/g:S/.s$/.o/g)
  84. POBJS        = $(OBJS:S/.o$/.po/g)
  85.  
  86. LD        ?= $(BINDIR)/ld
  87. RM        ?= $(BINDIR)/rm
  88. MV        ?= $(BINDIR)/mv
  89. CP        ?= $(BINDIR)/cp
  90. UPDATE        ?= $(BINDIR)/update
  91. SED        ?= $(BINDIR)/sed
  92. CPP        ?= /sprite/lib/cpp
  93. LINT        ?= $(BINDIR)/lint
  94.  
  95. .MAKEFLAGS    : -C
  96.  
  97. #
  98. # Compiler flags. Note any machine-specific flags (e.g. -m68010) are defined
  99. # in the including makefile
  100. #
  101. CCFLAGS        ?=
  102. CAFLAGS        ?=
  103. CTFLAGS        ?=
  104. CFLAGS        += -D$(MACH) -g -I. $(.INCLUDES) $(.LIBS) $(CCFLAGS)
  105. AFLAGS        += $(CAFLAGS)
  106. LINTFLAGS    += -u
  107.  
  108. .PATH.h        :
  109. .PATH.h        : .. $(INCLUDEDIR)
  110. .PATH.ln    : $(LINTDIR)
  111. .PATH.c        : ..
  112. .PATH.s        : ..
  113.  
  114. .SUFFIXES    : .po
  115.  
  116. #
  117. # Transformation rules
  118. #
  119. .c.po        :
  120.     $(CC) -S $(CFLAGS) -p -DPROFILE $(.IMPSRC)
  121.     $(AS) -o $(.TARGET) $(AFLAGS) $(.PREFIX).s
  122.     $(RM) -f $(.PREFIX).s
  123.  
  124. .s.po .s.o    :
  125.     $(CPP) $(CFLAGS:M-[ID]*) $(.IMPSRC) > $(.PREFIX).pp
  126.     $(AS) -o $(.TARGET) $(AFLAGS) $(.PREFIX).pp
  127.     $(RM) -f $(.PREFIX).pp
  128.  
  129.  
  130. #
  131. # Module-specific targets that actually correspond to files
  132. #
  133. $(MODULE).o    : $(OBJS)
  134.     rm -f $(.TARGET)
  135.     $(LD) -r $(.ALLSRC) -o $(.TARGET)
  136.  
  137. llib-l$(MODULE).ln    : $(CSRCS) $(HDRS)
  138.     $(RM) -f $(.TARGET)
  139.     $(LINT) -C$(MODULE) $(CFLAGS:M-[ID]*) $(LINTFLAGS) $(.ALLSRC:M*.c)
  140.  
  141. $(LINTDIR)/$(MODULE).ln : llib-l$(MODULE).ln
  142.     $(RM) -f $(.TARGET)
  143.     $(CP) llib-l$(MODULE).ln $(.TARGET)
  144.  
  145. $(LIBDIR)/$(MODULE).o    : $(MODULE).o
  146.     $(UPDATE) $(MODULE).o $(LIBDIR)
  147.  
  148. $(PROFDIR)/$(MODULE).o    : $(POBJS)
  149.     $(RM) -f $(.TARGET)
  150.     $(LD) -o $(.TARGET) -r $(.ALLSRC)
  151.  
  152. #
  153. # Alias targets
  154. #
  155. install        :: installobj instlint installsrc
  156. instlint    :: $(LINTDIR)/$(MODULE).ln
  157. installobj    :: $(LIBDIR)/$(MODULE).o
  158. profile        :: $(PROFDIR)/$(MODULE).o
  159. lint        : $(CSRCS) $(LINTLIBS) 
  160.     $(RM) -f $(.TARGET)
  161.     $(LINT) $(LINTFLAGS) $(CFLAGS:M-[ID]*) $(.ALLSRC) > lint 2>& 1
  162.  
  163. installsrc    :: installhdrs
  164. installsrc    ::
  165. #if !empty(MDCSRCS) || !empty(MDSSRCS)
  166.     $(UPDATE) $(MDCSRCS) $(MDSSRCS) $(INSTALLDIR)
  167. #endif
  168.  
  169. installhdrs    ::
  170. #if !empty(MDPUBHDRS)
  171.     $(UPDATE) $(MDPUBHDRS) $(INCLUDEDIR)
  172. #endif
  173. #if !empty(MDHDRS)
  174.     $(UPDATE) $(MDHDRS) $(INSTALLDIR)
  175. #endif
  176.  
  177. clean        ::
  178.     $(RM) -f lint *.o *.po *~
  179.  
  180. #
  181. # Because the entries in the tags file will be accessed from the directory
  182. # in which the tags file resides, and the machine-dependent sources aren't
  183. # there, we change all the source file names to be absolute by prepending
  184. # the current directory to them. This is how they'll appear in the tags file.
  185. #
  186. tags        :: $(CSRCS) $(HDRS)
  187.     cwd=`pwd`
  188.     ctags $(CTFLAGS) `echo $(.ALLSRC) | \
  189.                 sed -e "s%^%$cwd/%" -e "s% % $cwd/%g"`
  190.     cp tags ..
  191.  
  192. DEPFLAGS    += -w50
  193. NODEPEND    = TRUE
  194. #include    <makedepend.mk>
  195.  
  196. #
  197. # After creating the dependencies file (and only if we created it), make all
  198. # the profiled objects depend on the same things as their non-profiled
  199. # counterparts by inserting the correct .po file at the beginning of each
  200. # non-comment line in the file.
  201. #
  202. depend        : $(DEPFILE) .JOIN
  203.     $(MV) $(DEPFILE) $(DEPFILE).$$$$
  204.     $(SED) -e '/^#/!s/^\([^:]*\)\.o[     ]*:/\1.po &/' < $(DEPFILE).$$$$ \
  205.         > $(DEPFILE)
  206.     $(RM) -f $(DEPFILE).$$$$
  207.  
  208. $(DEPFILE)    ! $(CSRCS) $(SSRCS) MAKEDEPEND
  209.  
  210. mkmf         :: # Does nothing. says nothing
  211. @
  212.  
  213.  
  214. 1.7
  215. log
  216. @Added tags rule
  217. @
  218. text
  219. @d14 1
  220. a14 1
  221. # $Header: kernelObj.mk,v 1.6 88/05/04 14:04:23 deboor Exp $ SPRITE (Berkeley)
  222. d45 1
  223. a45 1
  224. CFLAGS        += -D$(MACH) -g $(.INCLUDES) $(.LIBS) $(CCFLAGS)
  225. @
  226.  
  227.  
  228. 1.6
  229. log
  230. @Added passing of .s sources to makedepend as well as .c sources...
  231. @
  232. text
  233. @d9 2
  234. a10 2
  235. #    MACH        Machine for which module is being created
  236. #    MACHDIR        Machine-specific directory suffix
  237. d14 1
  238. a14 1
  239. # $Header: kernelObj.mk,v 1.5 88/04/29 18:34:33 deboor Exp $ SPRITE (Berkeley)
  240. d44 1
  241. d106 3
  242. a108 3
  243.     if [ ! -z "$(MDCSRCS)" -o ! -z "$(MDSSRCS)" ]; then
  244.         $(UPDATE) $(MDCSRCS) $(MDSSRCS) $(INSTALLDIR)
  245.     fi
  246. d111 6
  247. a116 6
  248.     if [ ! -z "$(MDPUBHDRS)" ]; then 
  249.         $(UPDATE) $(MDPUBHDRS) $(INCLUDEDIR)
  250.     fi
  251.     if [ ! -z "$(MDHDRS)" ]; then
  252.         $(UPDATE) $(MDHDRS) $(INSTALLDIR)
  253.     fi
  254. d120 12
  255. @
  256.  
  257.  
  258. 1.5
  259. log
  260. @Added Header
  261. @
  262. text
  263. @d14 1
  264. a14 1
  265. # $Header$ SPRITE (Berkeley)
  266. d136 1
  267. a136 1
  268. $(DEPFILE)    ! $(CSRCS) MAKEDEPEND
  269. @
  270.  
  271.  
  272. 1.4
  273. log
  274. @Added installation of machine-dependent sources
  275. @
  276. text
  277. @d14 2
  278. @
  279.  
  280.  
  281. 1.3
  282. log
  283. @Added use of $(AFLAGS) in .c -> .po transformation
  284. @
  285. text
  286. @d18 3
  287. a20 2
  288. LINTDIR        ?= /sprite/src/kernel/Lint/$(MACHDIR)
  289. LIBDIR        ?= /sprite/src/kernel/Object/$(MACHDIR)
  290. d54 3
  291. d68 3
  292. d90 4
  293. a93 1
  294. install        :: installobj instlint
  295. d100 14
  296. @
  297.  
  298.  
  299. 1.2
  300. log
  301. @Added command-line flags for AS and CC
  302. @
  303. text
  304. @d55 1
  305. a55 1
  306.     $(AS) -o $(.TARGET) $(.PREFIX).s
  307. d58 1
  308. a58 1
  309. .s.o        :
  310. @
  311.  
  312.  
  313. 1.1
  314. log
  315. @Initial revision
  316. @
  317. text
  318. @d35 8
  319. a42 1
  320. CFLAGS        += -D$(MACH) -g $(.INCLUDES) $(.LIBS)
  321. d49 1
  322. d60 1
  323. a60 1
  324.     $(AS) -o $(.TARGET) $(.PREFIX).pp
  325. @
  326.